package com.village.zpark.pojo;

import com.village.zpark.common.DateUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Data
@Table(name="cadres")
public class Cadres {//干部表
    @Id
    @Column(name="id")//主键
    private Integer id;
    @Column(name="name")
    private String name;
    @Column(name="gender")
    private String gender;
    @Column(name="age")
    private Integer age;
    @Column(name="phone")
    private String phone;
    @Column(name="idcard")
    private String idcard;
    @Column(name="address")
    private String address;
    @Column(name="period")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date period;
    @Column(name="education")
    private String education;
    public String getPeriodStr(){
        return DateUtil.dateConvert(period);
    }
}
